<script setup>
import { useEditor } from '@/views/Editor/app'
import { computed } from 'vue'

const {
  canvas,
  keybinding,
  undoRedo,
} = useEditor()
function undo() {
  keybinding.trigger('mod+z')
}
function redo() {
  keybinding.trigger('mod+y')
}

</script>

<template>
  <ASpace>
    <ATooltip
      effect="dark"
      content="撤销"
      mini
    >
      <AButton
        class="icon-btn pd-5px"
        :disabled="!undoRedo.canUndo()"
        @click="undo()"
      >
        <IconUndo :size="18" />
      </AButton>
    </ATooltip>
    <ATooltip
      effect="dark"
      content="恢复"
      mini
    >
      <AButton
        class="icon-btn pd-5px"
        :disabled="!undoRedo.canRedo()"
        @click="redo()"
      >
        <IconRedo :size="18" />
      </AButton>
    </ATooltip>
  </ASpace>
</template>

<style scoped>

</style>
